<%@ page language="java" import="java.util.*,com.mlqsknow.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/WEB-INF/tlds/messageTag.tld" prefix="msg"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>登  录</title>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="renderer" content="webkit">
	<meta name="description" content="登录页">
	<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-3.1.1.min.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<!-- <style type="text/css">
		 body{margin:0;padding: 0;}
		.headerdiv{height:20px;width:100%;background-color: #FFEC8B;}
		.maindiv{height:100%;width:100%;min-height:768px;min-width:1024px;background-color:lightblue;margin-top:0px;padding-top: 0px;}
		.bottomdiv{height:100px;background-color:grey;}
		.textcss{height:30px;width:300px;}
		.logindiv{width:300px;height:200px;padding-left:7px;padding-right:7px;margin: 0 auto;overflow: hidden;margin-top: 5%; border-style:solid; border-width:8px; border-color:white}
		.usernamecss{padding: 9px 0px 8px 20px;background-image:url("http://localhost:8080/Light/img/login/input_icons.png");background-position:-5px -108px;background-repeat: no-repeat;}
		.pwdcss{padding: 9px 0px 8px 20px;background-image:url("http://localhost:8080/Light/img/login/input_icons.png");background-position:-5px -187px;background-repeat: no-repeat;}
	</style> -->
	
	<script type="text/javascript">
	if(top.location.href.endsWith("login.jsp")) {
		location.href="${pageContext.request.contextPath}/page/index.jsp";
	}
	function loadMsg() {
		var msg = "${msg}";
		if(msg!="") {
			alert(msg);	
		}
		
		$("#username").focus();
	}
	
	function checkLoginInfo() {
		var username = $("#username").val();
		if(username=="") {
			alert("<msg:message key='login.msg.username.empty' />" + "！");
			$("#username").focus();
			return false;
		}
		var pwd = $("#pwd").val();
		if(pwd=="") {
			alert("<msg:message key='login.msg.password.empty' />" + "！");
			$("#pwd").focus();
			return false;
		}
		
		return true;
	}
	
	function changeLanguage(language) {
		location.href="${pageContext.request.contextPath}/loginpage.do?language="+language;
	}
	</script>
  </head>
  
  <body onload="loadMsg()">
  
  <div class="login-page">
  		<label style="float:right;margin:20px 20px 20px 20px;cursor:pointer;" onclick="changeLanguage('en')" ><font color="white">English</font></label>
  		<label style="float:right;margin:20px 0px 0px 0px;cursor:pointer;" ><font color="white">|</font></label>
  		<label style="float:right;margin:20px;cursor:pointer;" onclick="changeLanguage('zh')"><font color="white">中文</font></label>
		<div class="login-box">
			<div class="login-div">
				<div class="login-div-cont">
					<div class="login-title">
						<div class="login-title-text"><i class="login-title-logo"></i><msg:message key="system.name" /></div>
					</div>
					<div class="login-cont-space">
						<div class="block30"></div>
						<form id="loginform" name="loginform" action="${pageContext.request.contextPath}/login.do" method="post" onsubmit="return checkLoginInfo();">
						<div class="login-view">
							<span class="login-view-text"><msg:message key="login.username" />：</span>
							<input type="text" name="username" id="username" value="${userName }" class="login-input">
						</div>
						<div class="block20"></div>
						<div class="login-view">
							<span class="login-view-text"><msg:message key="login.password" />：</span>
							<input type="password" name="pwd" id="pwd" class="login-input">
						</div>
						<div class="block20"></div>
						<div class="login-oper">
							<div class="left login-remember"><input type="checkbox" class="login-remember-checkbox" name="" id="loginRememberCheckbox" /><label for="loginRememberCheckbox"><msg:message key="login.rememberpwd" /></label></div>
							<div class="right"><input type="submit" class="login-submit-btn" value="<msg:message key='login.button' />" /></div>
							<div class="clear"></div>
						</div>
						</form>
					</div>
				</div>
				<div class="login-div-bg"></div>
			</div>
		</div>
		<div style="position:absolute;bottom:-20px;margin-left: 500px;margin:0 auto;">版权所有：扬州东泰电源有限公司  || <a style="padding-left:10px;" href="http://www.beian.miit.gov.cn/"> 苏ICP备19074649号-2</a></div>
	</div>
	<!-- 底部加载js -->
  	<!-- <div id="main" class="maindiv">
  		<div id="header" class="headerdiv">
  			(●'◡'●)欢迎来到灯控系统
  		</div>
  		<div class="logindiv">
	  		<form id="loginform" name="loginform" action="login.do" method="post">
		  		<table style="width: 100%;height: 100%;">
		  			<tr>
		  				<td>用户登录</td>
		  			</tr>
		  			<tr>
		  				<td><label>
		  				<input type="text" name="username" maxlength="20" class="usernamecss textcss"/>
		  				</label></td>
		  			</tr>
		  			<tr>
		  				<td><input type="password" name="pwd" maxlength="20" class="pwdcss textcss"/></td>
		  			</tr>
		  			<tr>
		  				<td><input type="submit" value="登   录" style="width:100%;height:30px;"/></td>
		  			</tr>
		  		</table>
	  		</form>
	  	</div>
  	</div> -->
  </body>
</html>
